<template>
    <el-form :inline="true" :model="container" class="search-form" style="margin-top:10px" label-width="100px">
        <el-row>
            <el-col :span="6">
                <el-form-item label="委托号">
                    <!-- <el-input style="width:150px" v-model="container.containerNo"></el-input> -->
                    <auto-search-gate-entrust v-model="entust.entrustNo" @matchRecord="handleSelect" :styleProps="'width:150px'"></auto-search-gate-entrust>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="提箱数量">
                    <!-- <el-input style="width:150px" v-model="entust.jobNum"></el-input> -->
                    <el-input-number :controls="false" v-model="entust.jobNum" :min="1" :max="entust.enabledNum" style="width:150px" ></el-input-number>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="委托单位">
                    <el-input style="width:150px" :disabled="true" v-model="entust.entrustOrgName"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="预计作业数量">
                    <el-input style="width:150px" :disabled="true" v-model="entust.containerNum"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="6">
                <el-form-item label="已作业数量">
                    <el-input style="width:150px" :disabled="true" v-model="entust.completedNum"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="可提数量">
                    <el-input style="width:150px" :disabled="true" v-model="entust.enabledNum"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="箱型">
                    <el-input style="width:150px" :disabled="true" v-model="entust.containerType"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="尺寸">
                    <el-input style="width:150px" :disabled="true" v-model="entust.containerSize"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
        <el-row>
            <el-col :span="6">
                <el-form-item label="空重">
                    <el-input style="width:150px" :disabled="true" v-model="entust.ifHeavy"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="内外贸">
                    <el-input style="width:150px" :disabled="true" v-model="entust.tradeType"></el-input>
                </el-form-item>
            </el-col>
            <el-col :span="6">
                <el-form-item label="箱主">
                    <el-input style="width:150px" :disabled="true" v-model="entust.ownerName"></el-input>
                </el-form-item>
            </el-col>
        </el-row>
    </el-form>
</template>

<script>
import autoSearchGateEntrust from "@/components/autocomplete/autoSearchGateEntrust";
import { ifHeavyType, tradeType } from "@/assets/dict";
export default {
    props: {
        container: {
            type: Object,
            default: {}
        }
    },
    data() {
        return {
            entust: {}
        };
    },
    components: {
        autoSearchGateEntrust
    },
    methods: {
        handleSelect(val) {
            this.$emit('update:container', JSON.parse(JSON.stringify(val)))
            // this.entust=JSON.parse(JSON.stringify(val))
            this.entust.entrustNo = val.entrustNo;
            this.entust.jobNum = val.jobNum;
            this.entust.entrustOrgName = val.entrustOrgName;
            this.entust.entrustOrgId = val.entrustOrgId;
            this.entust.containerNum = val.containerNum;
            this.entust.completedNum = val.completedNum;
            this.entust.enabledNum = val.enabledNum;
            this.entust.containerType = val.containerType;
            this.entust.containerSize = val.containerSize;
            this.entust.ifHeavy = ifHeavyType.get(val.ifHeavy);
            this.entust.tradeType = tradeType.get(val.tradeType);
            this.entust.ownerName = val.ownerName;
            this.entust.ownerId = val.ownerId;
        }
    },
};
</script>

<style>
</style>
